<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增用户管理')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-subscribe-add">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">账号：</label>
                <div class="col-sm-8">
                    <input name="subscriber" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">密码：</label>
                <div class="col-sm-8">
                    <input name="password" class="form-control" type="password" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">姓名：</label>
                <div class="col-sm-8">
                    <input name="realname" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <input type="radio" id="enabled" name="status" value="enabled" checked>
                        <label th:for="enabled" th:text="正常"></label>
                    </div>
                    <div class="radio-box">
                        <input type="radio" id="disabled" name="status" value="disabled">
                        <label th:for="disabled" th:text="停用"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">到期时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="expireTime" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">最大在线：</label>
                <div class="col-sm-8">
                    <input name="activeNum" class="form-control" type="number" value="1" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">上行速率(Mbps)：</label>
                <div class="col-sm-8">
                    <input name="upRate" class="form-control" type="number" value="10" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">下行速率(Mbps)：</label>
                <div class="col-sm-8">
                    <input name="downRate" class="form-control" type="number" value="10" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">突发上行速率(Mbps)：</label>
                <div class="col-sm-8">
                    <input name="upPeakRate" class="form-control" type="number" value="10" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">突发下行速率(Mbps)：</label>
                <div class="col-sm-8">
                    <input name="downPeakRate" class="form-control" type="number" value="10" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">绑定MAC：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('radius_bind_mac')}">
                        <input type="radio" th:id="${dict.dictCode}" name="bindMac" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">绑定VLAN：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('radius_bind_vlan')}">
                        <input type="radio" th:id="${dict.dictCode}" name="bindVlan" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">地址池：</label>
                <div class="col-sm-8">
                    <input name="addrPool" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">固定IP地址：</label>
                <div class="col-sm-8">
                    <input name="ipAddr" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">MAc地址：</label>
                <div class="col-sm-8">
                    <input name="macAddr" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">内层VLAN：</label>
                <div class="col-sm-8">
                    <input name="inVlan" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">外层VLAN：</label>
                <div class="col-sm-8">
                    <input name="outVlan" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">认证域：</label>
                <div class="col-sm-8">
                    <input name="domain" class="form-control" type="text" value="wlan">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">上行速率策略：</label>
                <div class="col-sm-8">
                    <input name="upRateCode" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">下行速率策略：</label>
                <div class="col-sm-8">
                    <input name="downRateCode" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">自定义策略：</label>
                <div class="col-sm-8">
                    <textarea name="policy" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "radius/subscribe"
        $("#form-subscribe-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-subscribe-add').serialize());
            }
        }
        $("input[name='expireTime']").datetimepicker({
            format: "yyyy-mm-dd HH:ii:ss",
            autoclose: true,
            minView: 0,
            minuteStep:1
        });
    </script>
</body>
</html>